Terminal Management
Connect
connect Method
Connects to a payment terminal. Whenever the connection to the device is lost, the SDK will keep on trying to establish a connection until it’s re-established. No special actions are needed.
Parameters
| Parameter | Notes |
|---|---|
device Required Device | This parameter specifies which device type you want to connect to. |
Code example
//Connect to a device
Device device = new Device("CardReader7", "08:00:69:02:01:FC", "1", ConnectionMethod.BLUETOOTH);
Device device = new Device("LocalDevice", "0821032398-PAXA920", "", ConnectionMethod.ANDROID_PAYMENT);
Device device = new Device("CloudDevice", "0821032398-PAXA920", "", ConnectionMethod.CLOUD);
api.connect(device);
Events invoked
Each time the card reader state changes (ex : going from Connected to Disconnected) the ConnectionStatusChanged event is called. It causes the connection manager to invoke this event with the appropriate information.
Returns
| Parameter | Notes |
|---|---|
Boolean | true if the operation was successfully. |
Disconnect
disconnect Method
Disconnect will stop the active connection (or reconnection process). Please note that the method ignores the current state of the payment terminal and just stops the connection. Calling disconnect might result in a commmunication error if triggered during a transaction.
Code example
//Disconnects from the payment terminal
api.Disconnect();
Events invoked
Causes the connection manager to invoke this event with the appropriate information.
Returns
| Parameter | Notes |
|---|---|
Boolean | True if the operation was successful. |
Get Device Manufacturer
getDeviceManufacturer Method
Code example
Manufacturer manufacturer = api.getDeviceManufacturer();
Returns
| Parameter | Notes |
|---|---|
| Manufacturer | The payment terminal manufacturer. |
Get EMV Report
getEMVConfiguration Method
Fetches the logs from the device and reports them to the deviceLogsReady event.
Code example
//Downloads logs from device
api.getDeviceLogs();
Events invoked
Invoked when the sdk has finished downloading the EMV report from the payment terminal.
Returns
| Parameter | Notes |
|---|---|
Boolean | True if the operation was successfully sent to device. |
Get Paired Devices
getPairedDevices Method
Returns the payment terminals associated with the specified ConnectionMethod.
Parameters
| Parameter | Notes |
|---|---|
method Required *ConnectionMethod * | The type of connection with the payment terminal (Bluetooth, Cloud, etc.). |
Code example
// Get paired terminals
List Device devices = api.getPairedDevices(ConnectionMethod.XXX);
Returns
| Parameter | Notes |
|---|---|
List Device | The list of payment terminals. |
Get Transactions Report
getTransactionsReport Method
Fetches your transactions report from a payment terminal. If you want to print the report, you can call printReceipt with the string returned in ReportResult event as parameter.
Parameters
| Parameter | Notes |
|---|---|
reportConfiguration Required ReportConfiguration | This parameter specifies the filter to get transactions report. |
Code example
//Get the transactions report for device "12345", from 30th April 2021 at 00:00:00, to 30th April 2021 at 23:59:59, in eurs:
List terminalSerialNumber = new ArrayList<>();
terminalSerialNumber.add("12345");
ReportConfiguration configuration = new ReportConfiguration("EUR", "20210430000000", "20210430235959", terminalSerialNumber);
api.getTransactionsReport(configuration);
Events invoked
The report will be returned to the registered ReportResult interface.
Returns
| Parameter | Notes |
|---|---|
Boolean | True if the command was processed successfully. False if the sending was not successful. |
Flash Reset
deleteDeviceConfig Method
Sends a command to the payment terminal to delete its configuration.
Code example
api.deleteDeviceConfig();